import 'package:get/get.dart';

import '../../../network/HttpGo.dart';

class HomeLogic extends GetxController {
  List<dynamic>? records = [];
  @override
  void onInit() {
    super.onInit();
    getGoodGoods();
  }

  Future getGoodGoods() async {
    final params = {
      "classifyId": 2,
      "pageNum": 1,
      "pageSize": 20,
      "type": 2,
    };
    final res = await HttpGo.instance
        .post("/pms/pagePms", data: params)
        .whenComplete(() => Get.back());
    res.ifSuccess((data) {
      printInfo(info: "推荐===${data.toString()}");

      if (data != null) {
        records = data['records'];
      }
      //printInfo(info: "records===${records.toString()}");
    });
    res.ifFailure((e) => e.toast());
  }
}
